require 'mkmf'

system("git clone https://git.scc.kit.edu/ComPlat/rinchi.git") or abort

inc_dirs = '-I. -I./rinchi/rinchi/lib -I./rinchi/rinchi/parsers -I./rinchi/rinchi/rinchi -I./rinchi/rinchi/writers -I./rinchi/INCHI-1-API/INCHI_API/inchi_dll'

system("swig #{inc_dirs} -c++ -ruby rinchi.i") or abort

$INCFLAGS << inc_dirs

$srcs = [
	'rinchi.cpp',
	'rinchi_wrap.cxx',
    './rinchi/rinchi/lib/rinchi_utils.cpp',
    './rinchi/rinchi/lib/rinchi_logger.cpp',
    './rinchi/rinchi/lib/inchi_api_intf.cpp',
    './rinchi/rinchi/lib/inchi_generator.cpp',
    './rinchi/rinchi/lib/rinchi_hashing.cpp',
    './rinchi/rinchi/parsers/mdl_molfile.cpp',
    './rinchi/rinchi/parsers/mdl_molfile_reader.cpp',
    './rinchi/rinchi/parsers/mdl_rxnfile_reader.cpp',
    './rinchi/rinchi/parsers/mdl_rdfile_reader.cpp',
    './rinchi/rinchi/parsers/rinchi_reader.cpp',
    './rinchi/rinchi/writers/mdl_rxnfile_writer.cpp',
    './rinchi/rinchi/writers/mdl_rdfile_writer.cpp',
    './rinchi/rinchi/rinchi/rinchi_reaction.cpp',
    './rinchi/rinchi/rinchi/rinchi_consts.cpp',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichi_bns.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichi_io.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichican2.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichicano.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichicans.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiisot.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichilnct.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichimak2.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichimake.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichimap1.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichimap2.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichimap4.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichinorm.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiparm.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiprt1.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiprt2.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiprt3.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiqueu.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiread.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiring.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr1.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr2.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr3.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr4.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr5.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr6.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr7.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichisort.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichister.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichitaut.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ikey_base26.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ikey_dll.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/inchi_dll.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/inchi_dll_a.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/inchi_dll_a2.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/inchi_dll_main.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/runichi.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/sha2.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/strutil.c',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/util.c',
]

$objs = [
    'rinchi.o',
    'rinchi_wrap.o',
    './rinchi/rinchi/lib/rinchi_utils.o',
    './rinchi/rinchi/lib/rinchi_logger.o',
    './rinchi/rinchi/lib/inchi_api_intf.o',
    './rinchi/rinchi/lib/inchi_generator.o',
    './rinchi/rinchi/lib/rinchi_hashing.o',
    './rinchi/rinchi/parsers/mdl_molfile.o',
    './rinchi/rinchi/parsers/mdl_molfile_reader.o',
    './rinchi/rinchi/parsers/mdl_rxnfile_reader.o',
    './rinchi/rinchi/parsers/mdl_rdfile_reader.o',
    './rinchi/rinchi/parsers/rinchi_reader.o',
    './rinchi/rinchi/writers/mdl_rxnfile_writer.o',
    './rinchi/rinchi/writers/mdl_rdfile_writer.o',
    './rinchi/rinchi/rinchi/rinchi_reaction.o',
    './rinchi/rinchi/rinchi/rinchi_consts.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichi_bns.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichi_io.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichican2.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichicano.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichicans.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiisot.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichilnct.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichimak2.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichimake.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichimap1.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichimap2.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichimap4.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichinorm.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiparm.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiprt1.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiprt2.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiprt3.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiqueu.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiread.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichiring.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr1.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr2.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr3.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr4.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr5.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr6.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichirvr7.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichisort.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichister.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ichitaut.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ikey_base26.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/ikey_dll.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/inchi_dll.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/inchi_dll_a.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/inchi_dll_a2.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/inchi_dll_main.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/runichi.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/sha2.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/strutil.o',
    './rinchi/INCHI-1-API/INCHI_API/inchi_dll/util.o',
]

create_makefile('rinchi')
